1. Technical Field
The present invention relates to an improved data processing system and in particular to a method and apparatus for multitasking in a data processing system. Still more particularly, the present invention relates to a method and apparatus for monitoring and handling events for a plurality of related threads in a data processing system.
2. Description of Related Art
Java™ is an object oriented programming language and environment focusing on defining data as objects and the methods that may be applied to those objects. Java supports only a single inheritance, meaning that each class can inherit from only one other class at any given time. Java also allows for the creation of totally abstract classes known as interfaces, which allow the defining of methods that may be shared with several classes without regard for how other classes are handling the methods. Java provides a mechanism to distribute software and extends the capabilities of a Web browser because programmers can write an applet once and the applet can be run on any Java enabled machine on the Web.
The Java virtual machine (JVM) is a virtual computer component that resides only in memory. The JVM allows Java programs to be executed on different platforms as opposed to only the one platform for which the code was compiled. Java programs are compiled for the JVM. In this manner Java is able to support applications for many types of data processing systems, which may contain a variety of central processing units and operating systems architectures. To enable a Java application to execute on different types of data processing systems, a compiler typically generates an architecture-neutral file format the compiled code is executable on many processors, given the presence of the Java run time system. The Java compiler generates bytecode instructions that are non-specific to particular computer architectures. A bytecode is a machine independent code generated by the Java compiler and executed by a Java interpreter. A Java interpreter is a module in the JVM that alternatively decodes and executes a bytecode or bytecodes. These bytecode instructions are designed to be easy to interpret on any machine and easily translated on the fly into native machine code.
A development environment, such as the Java Development Kit (JDK) available from Sun Microsystems, Inc., may be used to build Java bytecode from Java language source code and libraries. This Java bytecode may be stored as a Java application or applet on a Web Server, where it can be downloaded over a network to a user's machine and executed on a local JVM.
JavaOS for Business is an Java operating system which allows java bytecode to execute in Java applications. Unlike typical client-server architectures, JavaOS for Business is network managed client to lower the cost of ownership and allow scaleable from high memory, fat clients computers to low memory, hand held devices or thin clients. JavaOS for Business is the first operating system largely implemented using Java. Platform hardware specific functions still use some native compiled code, but a large percentage (approximately 80-95%) of operating system tasks that are implemented in Java byte interpreted code. JavaOS for Business has the only operating system print subsystem implemented entirely in Java code. As a result the print subsystem can interact with lower level, platform specific subsystems such as the sending data to the network card or local ports, but is abstracted from low-level interaction (setup, initialization of devices, soft or hard data errors, write/read retries, etc.).
One problem with the print subsystem in JavaOS for Business is that a print subsystem is unable to obtain information about events, which affect printing because other parts of the operating system do not implement Operating System Events (OSEvent). Some subsystems use OSEvents to communicate state changes such as power management, server managed runtime system database data, devices such as audio volume, logon messages during booting, etc. OSEvent producers, consumers, enumerators and buffers are used to implement this operating system messaging. In addition to this problem, many subsystems do not implement OSEvents to communicate state changes, the print subsystem needs to remain implemented in platform-independent java code, unaware of the network, processor or system board printer attachment (parallel, serial, USB, etc).
Thus, it would be advantageous to have an improved method and apparatus for monitoring and handling events for a print subsystem.